package com.base.cn.platform.os.controller.logger;

import com.base.cn.platform.os.common.StaticBaseController;
import com.base.cn.platform.os.common.logger.GoodsGVUVLogger;
import com.base.cn.platform.os.common.logger.SubjectStudyLogger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

/**
 * 日志生成Controller
 *
 * @author s.li
 * @date 2019/05/05
 */
@RestController
@RequestMapping("/logger")
public class LoggerGenController extends StaticBaseController {

    /**
     * 生成专业学习日志
     * @param request
     * @param subjectIds 专业ID串
     */
    @RequestMapping("/genSubjectStudUvLog")
    public void genSubjectStudUvLog(HttpServletRequest request,
                                    @RequestParam("subjectIds") String subjectIds){
        SubjectStudyLogger.genSubjectStudUvLog(request,subjectIds);
    }

    /**
     * 生成商品PV/UV日志
     * @param request
     * @param goodsId
     * @param goodsType
     */
    @RequestMapping("/genGoodsPVUVLog")
    public void genGoodsPVUVLog(HttpServletRequest request,
                                @RequestParam("goodsId") BigDecimal goodsId,
                                @RequestParam("goodsType") String goodsType){
        GoodsGVUVLogger.genGoodsPVUVLog(request,goodsId,goodsType);
    }
}
